import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import '@/assets/css/iconfont.css'
import '@/assets/static/reset.css'
import NavBar from '@/components/NavBar.vue'
import {setCookie, getCookie, delCookie} from '@/utils/cookie.js';
import 'animate.css';
//轮播图
import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/css/swiper.css'
import Vant from 'vant';
import 'vant/lib/index.css';
Vue.use(Vant,ElementUI,axios,VueAwesomeSwiper)
let obj={}
// const $axios=axios.create(obj)
axios.defaults.baseURL="https://apis.netstart.cn/music/"
Vue.prototype.$http=axios
//请求拦截器
axios.interceptors.request.use(
  function(config) {

   
    // Do something before request is sent
    // Vue.$store.commit('ifLoading')
    return config;
  },
  function(error) {
    // Do something with request error
    return Promise.reject(error);
  }
)
//响应拦截器
axios.interceptors.response.use(
  (response)=>{
  
    // Vue.$store.commit('ifLoading')
    return response
  },
 (error)=>Promise.reject(error)
);

Vue.config.productionTip = false
Vue.component('NavBar',NavBar)
new Vue({
  router,
  store,
  beforeMount () {
    Vue.prototype.$cookieStore = {
      setCookie,
      getCookie,
      delCookie
    }
  }
,
  render: h => h(App)
}).$mount('#app')
